package cn.wildfire.chat.app.extendsion.classes;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

/**
 * Create by HEKE, 2019/8/25 21:52
 * TODO 安卓版本对象
 */
public class AndroidVersion implements Parcelable {

    public String androidVersionCode;
    public String id;
    public String packageName;
    public String url;

    public AndroidVersion() {
        super();
    }

    public AndroidVersion(String androidVersionCode, String id, String packageName, String url) {
        this.androidVersionCode = androidVersionCode;
        this.id = id;
        this.packageName = packageName;
        this.url = url;
    }

    protected AndroidVersion(Parcel in) {
        androidVersionCode = in.readString();
        id = in.readString();
        packageName = in.readString();
        url = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(androidVersionCode);
        dest.writeString(id);
        dest.writeString(packageName);
        dest.writeString(url);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<AndroidVersion> CREATOR = new Creator<AndroidVersion>() {
        @Override
        public AndroidVersion createFromParcel(Parcel in) {
            return new AndroidVersion(in);
        }

        @Override
        public AndroidVersion[] newArray(int size) {
            return new AndroidVersion[size];
        }
    };

    public String getAndroidVersionCode() {
        return androidVersionCode;
    }

    public void setAndroidVersionCode(String androidVersionCode) {
        this.androidVersionCode = androidVersionCode;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @NonNull
    @Override
    public String toString() {
        return id + "," + androidVersionCode + "," + packageName + "," + url;
    }
}
